package com.heima.App;

import com.heima.Config.springConfig;
import com.heima.dao.BookDao;
import com.heima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext app =
                new AnnotationConfigApplicationContext(springConfig.class);

       BookDao bookDao = app.getBean(BookDao.class);
       //bookDao.save();

        System.out.println("------------");

       /* int c = bookDao.update(4, 2);
        System.out.println(c);*/

        System.out.println("------------");

        UserService userService = app.getBean(UserService.class);
        userService.getUrl("   http://www.itcast.cn   " , "  1234  ");
    }
}
